Part 5 - Welicome to Sandbox

In the last tutorials, we've been initializing our hook and all of our workers by hand every time. This can be a bit annoying when you're just playing around / learning about the interfaces. So, from here on out we'll be creating all these same variables using a special convenience function.

Person wey translate am:


In [ ]:
import torch
import syft as sy
sy.create_sandbox(globals())

Wetin sandbox go give us?

As you don see sey we create several virtual workers and we come load am for plenti test dataset, to dey do privacy preserving techniques such as Federated Learning we go distribute am to various workers.

We don create six workers....


In [ ]:
workers

We go add sometin for the global variables wey we go use right away!


In [ ]:
hook

In [ ]:
bob

Part 2: Worker Search Functionality

To get abiliti to search for datasets on a remaote machine na one important aspect of doing remote data science. Make we think of research lab wey dey ask hospital for "radio" datasets.


In [ ]:
torch.Tensor([1,2,3,4,5])

In [ ]:
x = torch.tensor([1,2,3,4,5]).tag("#fun", "#boston", "#housing").describe("The input datapoints to the boston housing dataset.")
y = torch.tensor([1,2,3,4,5]).tag("#fun", "#boston", "#housing").describe("The input datapoints to the boston housing dataset.")
z = torch.tensor([1,2,3,4,5]).tag("#fun", "#mnist",).describe("The images in the MNIST training dataset.")

In [ ]:
x

In [ ]:
x = x.send(bob)
y = y.send(bob)
z = z.send(bob)

# make we search for exact match for this tag or for the description
results = bob.search(["#boston", "#housing"])

In [ ]:
results

In [ ]:
print(results[0].description)

Part 3: Virtual Grid

A Grid na collection of workers wey go fit give convenience functions for when you want put dataset togeda.


In [ ]:
grid = sy.PrivateGridNetwork(*workers)

In [ ]:
results = grid.search("#boston")

In [ ]:
boston_data = grid.search("#boston","#data")

In [ ]:
boston_target = grid.search("#boston","#target")

In [ ]: